package com.zhu.component.service;

import com.zhu.component.CacheTemplate;
import com.zhu.component.annotation.ZCache;
import com.zhu.component.dao.SkuDao;
import com.zhu.component.entity.Sku;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class SkuService {

    @Autowired
    SkuDao skuDao;

    @ZCache(key = "#id", scope = "sku")
    public Sku queryById(Integer id){

        return skuDao.createLambdaQuery().andEq(Sku::getId, id).single();
    }


}
